package com.kitchen.ui.controls.start
{
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	import flash.text.TextFieldAutoSize;

	internal class StartTip extends Sprite
	{
		public var state:Boolean;
		private var mainSkin:BitmapData;
		private var ntips:StartTipIcon;
		private var wtips:StartNoticeIcon;
		private var minute:TextField;
		private var second:TextField;
		
		public function StartTip(mainSkin:BitmapData)
		{
			super();
			this.state = false;
			this.mainSkin = mainSkin;
			this.layout();
		}
		
		private function layout():void{
			this.wtips = new StartNoticeIcon(this.mainSkin);
			this.addChild(this.wtips);
		}
		
		public function open():void{
			this.removeChild(this.wtips);
			this.wtips = null;
			this.state = true;
			this.ntips = new StartTipIcon(this.mainSkin);
			this.addChild(this.ntips);
			this.minute = new TextField();
			this.second = new TextField();
			this.minute.y = this.second.y = 20;
			this.minute.x = 36;
			this.second.x = 78;
			var tff:TextFormat = new TextFormat();
			tff.color = 0xda6321;
			tff.align = TextFormatAlign.LEFT;
			tff.size = 15;
			tff.font = '黑体';
			tff.bold = true;
			this.minute.selectable = this.second.selectable = false;
			this.minute.autoSize = this.second.autoSize = TextFieldAutoSize.LEFT;
			this.minute.defaultTextFormat = this.second.defaultTextFormat = tff;
			this.minute.text = '10';
			this.second.text = '10';
			this.addChild(this.minute);
			this.addChild(this.second);
		}
		
		public function showTime(minutes:int, second:int):void{
			this.minute.text = minutes+'';
			this.second.text = second+'';
		}
	}
}